var config = require('../../common/config.js');
var $ = require('../../common/helper.js');
var WxParse = require('../../common/wxParse/wxParse.js');
Page({
	data: {
		item: {},
		url: ''
	},
	onLoad: function (options) {
		$.setTitle('资讯详情');
		/*//
		if (!wx.canIUse('web-view')) {
			$.alert('您的微信客户端版本过低，请升级');
			return;
		}
		this.setData({
			url: $.wapUrl('wap.php?app=article&act=detail&id=' + options.id)
		});
		/*/
		var _this = this;
		$.get('api.php?app=article&act=detail&id=' + options.id, function (json) {
			_this.setData({
				item: json.data,
				url: $.wapUrl('wap.php?app=article&act=detail&id=' + options.id)
			});
			WxParse.wxParse('content', 'html', json.data.content, _this, 0);
		});
		//*/
	},
	onShareAppMessage: function (res) {
		return {
			title: $.config.shareTitle,
			imageUrl: $.config.shareImageUrl,
			path: this.route
		}
	}
})